package com.myapp.struts.menu;

import java.util.ArrayList;

public class GBAllDayXML {

    private static GBAllDayXML gbAllDayXMLObj;
    ArrayList<FoodItems> gbAllDayXMLArray = new ArrayList<FoodItems>();

    public static synchronized GBAllDayXML getSingletonObject() {
        if (gbAllDayXMLObj == null) {
            gbAllDayXMLObj = new GBAllDayXML();
        }
        return gbAllDayXMLObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getGBAllDayXML(String fileLoc) {
        String fileName = "";

        MenuRead menuReadObj = new MenuRead();
        gbAllDayXMLArray = menuReadObj.ReadMenu(Constants.GREAT_BRITAN);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        gbAllDayXMLArray = menuGenerateObj.GenerateMenu(gbAllDayXMLArray, Constants.ALL_DAY);

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(gbAllDayXMLArray, Constants.XML, fileLoc);
        return fileName;
    }
}
